import { Node } from "cc";

//播放特效所需参数
export interface playParticleOptions {
    ndEffect: Node,//特效节点
    speed?: number,//粒子播放速度
    isRecycle?: boolean,//是否回收
    recycleTime?: number, //多少秒回收，如果需要回收但不传值，则等特效都播放完成才回收
}
export enum CharacterClass {
    Warrior = "Warrior",
    Mage = "Mage",
    Archer = "Archer",
    // 可以添加更多角色类别
}
export enum GoldType {
    gold = "gold",
    ore = "ore",
}
export enum SkillType {
    Instant = "瞬间发",
    Range = "需要设置进攻范围",
}

export enum RangeType {
    Circle = "圆圈",
    Laser = "激光",
}
// DEFAULT：1 << 0，即 2^0 = 1
// player：1 << 1，即 2^1 = 2
// enemy：1 << 2，即 2^2 = 4
// arrow：1 << 3，即 2^3 = 8
// enemySkill：1 << 4，即 2^4 = 16
// friendly：1 << 5，即 2^5 = 32
export enum PHY_GROUP {
    DEFAULT = 1 << 0,//1
    player = 1 << 1,//2
    enemy = 1 << 2,//4
    arrow = 1 << 3,//8
    enemySkill = 1 << 4,//16
    friendly = 1 << 5,//32
};

export enum OBJ_TYPE {

    enemy = 1,//敌人


    friendly = 2,//友军


}

export class constant {
    public static isAD: boolean = true//是否开启广告
    //战斗血量提示
    public static FIGHT_TIP = {
        ADD_BLOOD: 0,//加血
        REDUCE_BLOOD: 1,//扣血
        CRITICAL_HIT: 2,//暴击
    }
    //界面优先级
    public static PRIORITY = {
        ZERO: 0,//最底层
        BLOOD: 5,//血条
        BLOOD_TIP: 6,//血量提示
        BLOOD_CRITICAL_TIP: 7,//暴击血量提示
        NORMAL: 10, //普通界面
        DIALOG: 100, //弹窗的Z序
        REWARD: 200, //奖励的弹窗
        WAITING: 300, //等待界面弹窗
        TIPS: 400, //提示
    }
    //血量提示方向
    public static BLOOD_TIP_DIRECTION = {
        MID_UP: 0,//中间向上
        LEFT_UP: 1,//左边向上
        RIGHT_UP: 2,//右边向上
    }
    public static wrramingY: number = 0.2//预警的Y增加
    public static characterConfig = {


        //GameApp.playerData获取
        Archer: {
            //基础属性  常量不动态更改
            oldConfig: {
                shengming: 300, // 初始血量
                gongji: 80,//基础攻击力 


                jiansu: 0,//给敌人减速 百分比
                baoji: 10,//暴击   百分比 最高80封顶
                fangyu: 0,//防御力  百分比  抵御百分之多少伤害  最高40封顶
                minjie: 0,//移动速度  百分比  最高200封顶 
            },
            //职业的天赋升级也写这里
            name: "弓箭手",
            modle: "player01",
            tsName: "player01",
            //最终属性 动态更改
            shengming: 0,
            gongji: 0,


            jiansu: 0,
            baoji: 0,
            fangyu: 0,
            minjie: 0,
            //玩家技能属性
            config: {
                arrow_count: {
                    key: "arrow_count",
                    name: "散射",
                    level: 0,//当前技能等级
                    icon: "",
                    str: "一次可发射多个弓箭",
                    goldType: GoldType.gold,
                    gold: 400,
                    max: 4,//最大技能等级
                    minLevel: 1//开启关卡 默认是1

                },

                gongji: {
                    key: "gongji",
                    name: "火焰之力",
                    level: 0,
                    icon: "",
                    str: "提升玩家攻击力",
                    gold: 150,
                    goldType: GoldType.gold,
                    max: 35,
                    minLevel: 1

                },

                jiansu: {
                    key: "jiansu",
                    name: "寒冰之力",
                    level: 0,
                    icon: "",
                    str: "使敌人减速并造成额外伤害",
                    gold: 150,
                    goldType: GoldType.gold,
                    max: 10,
                    minLevel: 1

                },

                baoji: {
                    key: "baoji",
                    name: "雷霆之力",
                    level: 0,
                    icon: "",
                    str: "提高暴击概率",
                    goldType: GoldType.gold,
                    gold: 300,
                    max: 15,
                    minLevel: 1

                },

                shengming: {
                    key: "shengming",
                    name: "生命",
                    level: 0,
                    icon: "",
                    str: "提升英雄血量",
                    gold: 50,
                    goldType: GoldType.gold,
                    max: 80,
                    minLevel: 1

                },
                fangyu: {
                    key: "fangyu",
                    name: "防御等级",
                    level: 0,
                    icon: "",
                    str: "提升玩家防御力",
                    gold: 150,
                    goldType: GoldType.gold,
                    max: 20,
                    minLevel: 1

                },



                jisu: {
                    key: "jisu",
                    name: "迅捷之力",
                    level: 0,
                    icon: "",
                    str: "增加弓箭发射速度",
                    gold: 100,
                    goldType: GoldType.gold,
                    max: 10,
                    minLevel: 1

                },

                shecheng: {
                    key: "shecheng",
                    name: "视野",
                    level: 0,
                    icon: "",
                    str: "增加弓箭射程",
                    gold: 125,
                    max: 10,
                    goldType: GoldType.gold,
                    minLevel: 1

                },
                baojiADD: {
                    key: "baojiADD",
                    name: "会心一击",
                    level: 0,
                    icon: "",
                    str: "增加暴击伤害",
                    gold: 200,
                    max: 10,
                    goldType: GoldType.gold,
                    minLevel: 1

                },


                minjie: {
                    key: "minjie",
                    name: "身轻如燕",
                    level: 0,
                    icon: "",
                    goldType: GoldType.gold,
                    str: "提升玩家移动速度",
                    gold: 80,
                    max: 10,
                    minLevel: 1

                },
                //主动技能相关
                sanlianjiCd: {
                    key: "sanlianjiCd",
                    name: "伺机待发",
                    level: 0,
                    icon: "",
                    goldType: GoldType.gold,
                    str: "缩短三连击冷却时间",
                    gold: 100,
                    max: 10,
                    minLevel: 3//需要关卡

                },

                hudunCD: {
                    key: "hudunCD",
                    name: "真气护体",
                    level: 0,
                    goldType: GoldType.gold,
                    icon: "",
                    str: "缩短能量护盾冷却时间",
                    gold: 100,
                    max: 10,
                    minLevel: 3//需要关卡

                },




                tornado_attack: {
                    key: "tornado_attack",
                    name: "凌冽之风",
                    level: 0,
                    icon: "",
                    goldType: GoldType.gold,
                    str: "增加火焰风暴攻击力",
                    gold: 380,
                    max: 10,
                    minLevel: 5//需要关卡

                },
                tornado_scale: {
                    key: "tornado_scale",
                    name: "烈焰收割",
                    level: 0,
                    icon: "",
                    str: "使你的火焰风暴变得更大",
                    gold: 200,
                    goldType: GoldType.gold,
                    max: 10,
                    minLevel: 5//需要关卡

                },

                tornado_Range: {
                    key: "tornado_Range",
                    name: "飓风暴走",
                    level: 0,
                    icon: "",
                    str: "增加火焰风暴攻击半径",
                    gold: 180,
                    max: 10,
                    goldType: GoldType.gold,
                    minLevel: 5//需要关卡
                },


                tornado_time: {
                    key: "tornado_time",
                    name: "永恒之力",
                    level: 0,
                    icon: "",
                    str: "增加火焰风暴持续时间",
                    gold: 200,
                    goldType: GoldType.gold,
                    max: 10,
                    minLevel: 5//需要关卡

                },



                jiguangAtaack: {
                    key: "jiguangAtaack",
                    name: "鞭笞",
                    level: 0,
                    goldType: GoldType.gold,
                    icon: "",
                    str: "增加魔法激光攻击力",
                    gold: 200,
                    max: 10,
                    minLevel: 8//需要关卡

                }



            },
            //四个主动技能属性
            skills: {
                "skill1": {
                    skillFunCB: null,
                    oldCd: 20,
                    cd: 20,
                    isAlltimeUse: false,
                    asset: [],
                    isRotate: false,
                    name: "三连击",
                    type: SkillType.Instant,//瞬发
                    //   damage: 40,//基础伤害 废弃
                    minLevel: 2
                },
                "skill2": {
                    asset: ["jiguang_skill"],
                    oldCd: 20,
                    cd: 20,
                    isAlltimeUse: false,
                    skillFunCB: null,
                    isRotate: true,//是否随摇杆旋转  
                    name: "魔法激光",
                    type: SkillType.Range,
                    rangeType: RangeType.Laser,
                    //    baseDamage: 35,
                    range: 10,//废弃
                    minLevel: 8,

                },
                "skill3": {
                    asset: ["longjuanf_skill"],
                    skillFunCB: null,
                    isAlltimeUse: false,
                    oldCd: 30,
                    cd: 30,
                    name: "火焰风暴",
                    isRotate: false,
                    type: SkillType.Range,
                    rangeType: RangeType.Circle,
                    //   baseDamage: 60,
                    range: 8,
                    minLevel: 5,
                },
                "skill4": {
                    oldCd: 40,
                    cd: 40,
                    isAlltimeUse: true,//护盾随时都让开启
                    skillFunCB: null,
                    isRotate: false,
                    asset: ["shieldShow", "shield"],
                    name: "能量护盾",
                    type: SkillType.Instant,
                    //  damage: 0, // 防护盾通常不造成伤害
                    minLevel: 3,
                },

            },
        },
        // 可以添加更多的角色和技能
    };


    public static heartA: number = 0.1//出红心概率
    public static coin: number = 0.9 // 出金币概率

    public static enemyAttack: number = 0.2//敌人每关提升多少伤害
    public static enemyHp: number = 0.3 //敌人每关提升多少血量


    public static friendlyAttack: number = 0.1//友军每关提升多少伤害
    public static friendlyHp: number = 0.1 //友军每关提升多少血量


    public static fangyuAttack: number = 0.1//城堡4大炮每关提升多少伤害

    public static towerAttack: number = 0.03//塔楼每关提升多少伤害
    public static buildData = {
        hp: {
            maxLevel: 80,
            level: 0,

            add: 200,
            goldType: GoldType.ore,
            gold: 85,
            str: "增加基地的防御",
            name: "巩固工事",
            ico: ""


        },

        friendly: {
            maxLevel: 20,
            level: 0,
            add: 0.2,

            goldType: GoldType.gold,
            gold: 300,
            str: "友军的出兵速度",
            name: "招兵买马",
            ico: ""
        },

        cannonAttack: {

            maxLevel: 10,
            level: 0,
            str: "增加炮塔攻击力",
            name: "火药研发",
            ico: "",
            add: 0.5,
            goldType: GoldType.ore,
            gold: 180


        },

        cannonRange: {

            maxLevel: 10,
            level: 0,
            str: "增加火炮射程",
            name: "弹道学",
            ico: "",

            add: 0.1,
            goldType: GoldType.ore,
            gold: 100

        }
    }
    public static friendlyData = {
        "altman": {
            AttackAdd: 0.3,//每升一级攻击力提高多少
            PhAdd: 0.3,//每升一级血量提高多少

            level: 1,
            isBuy: true,
            goldType: GoldType.gold,
            gold: 0,
            levelGold: 100,
            name: "奥特曼",
            str: "我就会用拳头捶敌人",

            maxLevel: 10,

        },
        "axe": {
            AttackAdd: 0.4,
            PhAdd: 0.2,//每升一级血量提高多少

            level: 1,
            isBuy: true,
            goldType: GoldType.gold,
            gold: 200,
            levelGold: 150,
            name: "斧头兵",
            str: "一把板斧走天下，我是流氓我怕谁。",
            maxLevel: 10,
        },
        "javelin": {
            AttackAdd: 0.5,
            PhAdd: 0.2,//每升一级血量提高多少

            level: 0,
            isBuy: false,
            goldType: GoldType.gold,
            gold: 400,
            levelGold: 220,
            name: "掷矛兵",
            str: "嗖的一声，问你怕不怕",
            maxLevel: 10,

        },
        "soldier": {
            AttackAdd: 0.5,
            PhAdd: 0.8,//每升一级血量提高多少

            level: 0,
            isBuy: false,
            goldType: GoldType.gold,
            gold: 520,
            levelGold: 300,
            name: "守护者",
            str: "我有宝剑和盾牌，我骄傲。",
            maxLevel: 10,

        },
        "clown": {
            AttackAdd: 0.6,
            PhAdd: 0.4,//每升一级血量提高多少

            level: 0,
            isBuy: false,
            goldType: GoldType.gold,
            gold: 450,
            levelGold: 300,
            name: "小丑",
            str: "小丑总是一个人在舞台上卖力地独舞。",
            maxLevel: 10,
        },
        "catapult": {
            AttackAdd: 0.8,
            PhAdd: 0.4,//每升一级血量提高多少

            level: 0,
            isBuy: false,
            goldType: GoldType.ore,
            gold: 320,
            levelGold: 200,
            name: "投石车",
            str: "我的科技含量很高。",
            maxLevel: 10,
        },

    }

    //游戏事件
    public static EVENT_NAME = {
        isMove: "isMove",  //玩家移动
        allSkillBtnEnabled: "allSkillBtnEnabled",//所有技能禁用
        subEnemyCount: "subEnemyCount",//敌人计数
        stopSkillCd: "stopSkillCd",//所有技能冷却

        skillFire: "skillFire",//技能释放

        upHomeTop: "upHomeTop",//更新大厅页面金币宝石

        showTip: "showTip",//消息框
        subBuildHp: "subBuildHp",//城堡掉血

       // showAddGold: "showAddGold",
        upGameStartTop: "upGameStartTop",//更新游戏页面金币宝石
        //所有升级页面的金币宝石UI更新
        upShopFriendlyTop: "upShopFriendlyTop",
        upShopbuildTop: "upShopbuildTop",
        upShopPlayerTop: "upShopPlayerTop",

      

    }

    //0.397 table posY
}
